From: Colin Walters Date: Fri, 12 Aug 2011 14:06:19 +0000 (-0400) Subject: dateMenu: Watch for a resume, and update the clock X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7943 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c714a66ba3a7bf20a9d85e624c9f43ea1e6b9dd5;p=gnome-shell.git dateMenu: Watch for a resume, and update the clock Otherwise it can be very out of date. https://bugzilla.gnome.org/show_bug.cgi?id=656403 --- diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index a48fde777..edad21e65 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -14,6 +14,7 @@ const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; const Calendar = imports.ui.calendar; +const UPowerGlib = imports.gi.UPowerGlib; // in org.gnome.desktop.interface const CLOCK_FORMAT_KEY = 'clock-format'; @@ -142,6 +143,10 @@ DateMenuButton.prototype = { this._desktopSettings.connect('changed', Lang.bind(this, this._updateClockAndDate)); this._clockSettings.connect('changed', Lang.bind(this, this._updateClockAndDate)); + // https://bugzilla.gnome.org/show_bug.cgi?id=655129 + this._upClient = new UPowerGlib.Client(); + this._upClient.connect('notify-resume', Lang.bind(this, this._updateClockAndDate)); + // Start the clock this._updateClockAndDate(); },